﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Currency.aspx.cs" Inherits="Main_Master_Currency" EnableEventValidation="false" %>
<%@ Register Src="~/User Controls/PageHeading.ascx" TagName="heading" TagPrefix="acc" %>
<%@ Register Src="~/User Controls/Pager.ascx" TagPrefix="custom" TagName="Pager" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title> 
    <link href="../../Styles/accounts.css" rel="Stylesheet" type="text/css" />  
    <script type="text/javascript">
        function checkdata() 
        {
            var text = document.getElementById("txtcurrency").value;
            if (text == "") 
            {
                alert("Enter the Currency.");
                return false;
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:Panel ID="pnlmain" runat="server">
    <div align="center">  
          <acc:heading ID="header1" runat="server" HeadingText="Currency Master" />
        <table width="50%" class="tablecontent">            
            <tr>
                <td class="headtd" width="60%" colspan="4">Add Currency</td>                             
            </tr>
            <tr>
                <td width="100px">
                    &nbsp;</td>
                <td>
                    <asp:Label ID="label1" runat="server" Text="Currency Name"></asp:Label></td>
                <td>
                    <asp:TextBox ID="txtcurrency" runat="server"></asp:TextBox>
                </td>
                <td  width="100px">
                    &nbsp;</td>
            </tr>
            <tr>
                <td>&nbsp;
                    </td>
                <td>&nbsp;
                    </td>
                <td>
                    <asp:Button ID="btncurrency" runat="server" CssClass="button" Text="Save" 
                        onclick="btncurrency_Click" OnClientClick="return checkdata();" />
                </td>
                <td>&nbsp;
                    </td>
            </tr>
            <%--<tr>
                <td class="headtd" width="60%" colspan="4">Currency Details</td>  
            </tr>
            <tr>
                <td colspan="4" align="center">
                    <asp:GridView ID="grdcurrncy" runat="server" CssClass="gridview"
                    AutoGenerateColumns="false" Width="50%">
                        <Columns>
                            <asp:TemplateField HeaderText="Sr.">
                                <ItemTemplate>
                                    <%#Container.DataItemIndex+1 %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Currency">
                                <ItemTemplate>
                                    <asp:Label ID="lblcurrency" runat="server" Text='<%#Bind("currency_name")%>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>--%>
        </table>
    
    </div>
    </asp:Panel>
    <asp:Panel id="pnlview" runat="server" Visible="false">
        <div align="center">
            <acc:heading ID="Heading1" runat="server" HeadingText="View Currency Master" />
            <div align="center">            
                <div style="padding-top: 15px; padding-bottom: 5px; margin-left: 30%;">
                    <div style="float: left;">
                        <custom:Pager ID="custPager" runat="server" />
                    </div>           
                    <div style="float: left;">
                        <asp:ImageButton ID="imgpdf" runat="server" ImageUrl="~/Images/PDF.png" 
                            onclick="imgpdf_Click" />&nbsp;
                        <asp:ImageButton ID="imgword" runat="server" ImageUrl="~/Images/word_icon.png" 
                            onclick="imgword_Click" />&nbsp;   
                        <asp:ImageButton ID="imgxl" runat="server" ImageUrl="~/Images/Excel.png" 
                            onclick="imgxl_Click" />
                    </div>
                </div>
            </div>
            <asp:GridView ID="grdview" runat="server" CssClass="gridview" 
            AutoGenerateColumns="False" onpageindexchanging="grdview_PageIndexChanging" 
            onrowcancelingedit="grdview_RowCancelingEdit" onrowediting="grdview_RowEditing" 
            onrowupdating="grdview_RowUpdating" Width="50%" DataKeyNames="id">
                <Columns>
                    <asp:TemplateField HeaderText="Sr. No">
                    <ItemTemplate>
                        <%#Container.DataItemIndex+1 %>
                    </ItemTemplate>
                </asp:TemplateField>
                    <asp:TemplateField HeaderText="Currency Name">
                    <ItemTemplate>
                        <asp:Label ID="lblcurrency" runat="server" Text='<%#bind("currency_name")%>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtcurrency" runat="server" Text='<%#bind("currency_name")%>' Width="100px"></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                    <asp:TemplateField ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                            CommandName="Edit" Text="Edit"></asp:LinkButton>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" 
                            CommandName="Update" Text="Update"></asp:LinkButton>
                        &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                            CommandName="Cancel" Text="Cancel"></asp:LinkButton>
                    </EditItemTemplate>
                </asp:TemplateField>
                </Columns>
            </asp:GridView>     
        </div>   
    </asp:Panel>
    </form>
</body>
</html>
